import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useMenuStore = defineStore('menu', () => {
  // 菜单数据
  const menuList = ref([
    {
      path: '/dashboard',
      name: '仪表盘',
      icon: 'el-icon-menu',
      children: [
        {
          path: '/dashboard/workspace',
          name: '工作台',
          icon: 'el-icon-monitor'
        },
      ]
    },
    {
      path: '/system',
      name: '用户管理',
      icon: 'el-icon-user',
      children: [
        {
          path: '/system/user',
          name: '用户管理',
          icon: 'el-icon-user'
        },
      ]
    },
  ])

  return {
    menuList
  }
}, {
  persist: {
    key: 'vue3-demo-menu',
    storage: localStorage,
    paths: ['menuList']
  }
}) 